﻿using System;

using System.Text;
using System.Web.UI.WebControls;

namespace QzEbook.BaseView
{
    public class OutUserPage:BasePage
    {
        protected StringBuilder sb;
        public OutUserPage()
        {
        }

        /// <summary>
        /// 创建菜单项;
        /// </summary>
        protected override void builderNav()
        {
            sb = new StringBuilder("<ul id=\"nav\">");
            sb.AppendFormat("<li><a href=\"{0}\" title=\"{1}\"><b>{1}</b></a></li>", "../default.xhtml", "首页");
            if (Session["User"] == null)
            {
                sb.AppendFormat("<li><a href=\"{0}\" title=\"{1}\"><b>{1}</b></a></li>", "Login.xhtml", "登陆");
                sb.AppendFormat("<li><a href=\"{0}\" title=\"{1}\"><b>{1}</b></a></li>", "Register.xhtml", "注册");
            }
            else
            {
                sb.AppendFormat("<li><a href=\"{0}\" title=\"{1}\"><b>{1}</b></a></li>", "UserPane.xhtml", "我的面板");
            }
            sb.AppendFormat("<li><a href=\"{0}\" title=\"{1}\"><b>{1}</b></a></li>", "Help.xhtml", "帮助");
            sb.Append("</ul>");

            Localize NavBar=this.Master.FindControl("NavBar") as Localize;
            if (NavBar != null)
            {
                NavBar.Text = sb.ToString();
            }
        }
    }
}